#include <QtGui>
#include "widget.h"
#include "window.h"
#include "glwidget.h"

#define BIOMASS_OPENGL_MODE 1

//! [0]
Window::Window() : QWidget()
{
    QGridLayout *layout = new QGridLayout;
    QTimer *timer = new QTimer(this);
#if (BIOMASS_OPENGL_MODE == 1)
    GLWidget*  glwidget = new GLWidget(&helper, this);
    layout->addWidget(glwidget, 0, 0);
    connect(timer, SIGNAL(timeout()), glwidget, SLOT(animate()));
#else
    Widget *native = new Widget(&helper, this);
    layout->addWidget(native, 0, 0);
    connect(timer, SIGNAL(timeout()), native, SLOT(animate()));
#endif
    setLayout(layout);
    timer->start(30);
    setWindowTitle(tr("Biomass"));
}
//! [0]
